from django.db import models
from users.models import User
from market.models import Market
from django.utils.timezone import now
# Create your models here.

#

class Comments(models.Model):
    content = models.TextField(null=False,blank=False,max_length=500,verbose_name='评论的内容')
    user = models.ForeignKey(User,on_delete=models.CASCADE)
    market = models.ForeignKey(Market,on_delete=models.CASCADE)
    comment_time = models.DateTimeField(default=now,verbose_name='评论时间')

    class Meta:
        verbose_name = '商品评论信息'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.content